<p-dataTable [value]="persons">
    <p-column field="id" header="id"></p-column>
    <p-column field="name" header="name">
        <template  let-col let-p="rowData" let-ri="rowIndex" pTemplate="body">
            <div>
                <span>{{p[col.field]}}</span>
                <div  *dynamicComponent="p.nameTemplate;context:p.nameContext||p.assemblyContext(ri,p);"></div>
            </div>
        </template>
    </p-column>
</p-dataTable>